package com.tepth.maintenancesystem.bean;

import android.os.Parcel;
import android.os.Parcelable;

import org.json.JSONObject;

/**
 * Created by LHQ on 2016/12/23.
 */

public class Contents implements Parcelable {
    private int id;
    private String sort;
    private String contentTypeCode;
    private String contentDesc;
    private String technicalRequirement;
    private String value;
    private String valueTypeCode;
    private String valueType;
    private String valueTypeDetail;
    private String valueUnit;
    private String valueDefault;
    private String workPersonCode;
    private String workPersonName;
    private String workTime;
    private String remark;
    private String isRequired;
    private String maxValue;
    private String minValue;

    private int templateId;//判断是否是追加作业
    private String maintenanceTypeCode;//判断是几级保养

    public Contents() {

    }

    public Contents(JSONObject object) throws Exception {
        this.id = object.getInt("Id");
        this.id = object.getInt("Id");
        this.sort = object.getString("Sort");
        this.contentTypeCode = object.getString("ContentTypeCode");
        this.contentDesc = object.getString("ContentDesc");
        this.technicalRequirement = object.getString("TechnicalRequirement");
        this.value = object.getString("Value");
        this.valueTypeCode = object.getString("ValueTypeCode");
        this.valueType = object.getString("ValueType");
        this.valueTypeDetail = object.getString("ValueTypeDetail");
        this.valueUnit = object.getString("ValueUnit");
        this.valueDefault = object.getString("ValueDefault");
        this.workPersonCode = object.getString("WorkPersonCode");
        this.workPersonName = object.getString("WorkPersonName");
        this.workTime = object.getString("WorkTime");
        this.remark = object.getString("Remark");
        this.isRequired = object.getString("IsRequired");
        this.maxValue = object.getString("MaxValue");
        this.minValue = object.getString("MinValue");
        this.templateId=object.getInt("TemplateId");
        this.maintenanceTypeCode=object.getString("MaintenanceTypeCode");
    }

    protected Contents(Parcel in) {
        id = in.readInt();
        sort = in.readString();
        contentTypeCode = in.readString();
        contentDesc = in.readString();
        technicalRequirement = in.readString();
        value = in.readString();
        valueTypeCode = in.readString();
        valueType = in.readString();
        valueTypeDetail = in.readString();
        valueUnit = in.readString();
        valueDefault = in.readString();
        workPersonCode = in.readString();
        workPersonName = in.readString();
        workTime = in.readString();
        remark = in.readString();
        isRequired = in.readString();
        maxValue = in.readString();
        minValue = in.readString();
        templateId=in.readInt();
        maintenanceTypeCode=in.readString();
    }

    public static final Creator<Contents> CREATOR = new Creator<Contents>() {
        @Override
        public Contents createFromParcel(Parcel in) {
            return new Contents(in);
        }

        @Override
        public Contents[] newArray(int size) {
            return new Contents[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getContentTypeCode() {
        return contentTypeCode;
    }

    public void setContentTypeCode(String contentTypeCode) {
        this.contentTypeCode = contentTypeCode;
    }

    public String getContentDesc() {
        return contentDesc;
    }

    public void setContentDesc(String contentDesc) {
        this.contentDesc = contentDesc;
    }

    public String getTechnicalRequirement() {
        return technicalRequirement;
    }

    public void setTechnicalRequirement(String technicalRequirement) {
        this.technicalRequirement = technicalRequirement;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getValueTypeCode() {
        return valueTypeCode;
    }

    public void setValueTypeCode(String valueTypeCode) {
        this.valueTypeCode = valueTypeCode;
    }

    public String getValueType() {
        return valueType;
    }

    public void setValueType(String valueType) {
        this.valueType = valueType;
    }

    public String getValueTypeDetail() {
        return valueTypeDetail;
    }

    public void setValueTypeDetail(String valueTypeDetail) {
        this.valueTypeDetail = valueTypeDetail;
    }

    public String getValueUnit() {
        return valueUnit;
    }

    public void setValueUnit(String valueUnit) {
        this.valueUnit = valueUnit;
    }

    public String getValueDefault() {
        return valueDefault;
    }

    public void setValueDefault(String valueDefault) {
        this.valueDefault = valueDefault;
    }

    public String getWorkPersonCode() {
        return workPersonCode;
    }

    public void setWorkPersonCode(String workPersonCode) {
        this.workPersonCode = workPersonCode;
    }

    public String getWorkPersonName() {
        return workPersonName;
    }

    public void setWorkPersonName(String workPersonName) {
        this.workPersonName = workPersonName;
    }

    public String getWorkTime() {
        return workTime;
    }

    public void setWorkTime(String workTime) {
        this.workTime = workTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getIsRequired() {
        return isRequired;
    }

    public void setIsRequired(String isRequired) {
        this.isRequired = isRequired;
    }

    public String getMaxValue() {
        return maxValue;
    }

    public void setMaxValue(String maxValue) {
        this.maxValue = maxValue;
    }

    public String getMinValue() {
        return minValue;
    }

    public void setMinValue(String minValue) {
        this.minValue = minValue;
    }

    public int getTemplateId() {
        return templateId;
    }

    public void setTemplateId(int templateId) {
        this.templateId = templateId;
    }

    public String getMaintenanceTypeCode() {
        return maintenanceTypeCode;
    }

    public void setMaintenanceTypeCode(String maintenanceTypeCode) {
        this.maintenanceTypeCode = maintenanceTypeCode;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(id);
        parcel.writeString(sort);
        parcel.writeString(contentTypeCode);
        parcel.writeString(contentDesc);
        parcel.writeString(technicalRequirement);
        parcel.writeString(value);
        parcel.writeString(valueTypeCode);
        parcel.writeString(valueType);
        parcel.writeString(valueTypeDetail);
        parcel.writeString(valueUnit);
        parcel.writeString(valueDefault);
        parcel.writeString(workPersonCode);
        parcel.writeString(workPersonName);
        parcel.writeString(workTime);
        parcel.writeString(remark);
        parcel.writeString(isRequired);
        parcel.writeString(maxValue);
        parcel.writeString(minValue);
        parcel.writeInt(templateId);
        parcel.writeString(maintenanceTypeCode);
    }
}
